
<div class="content">
    <form id="add-form" class="form-horizontal nice-validator n-default n-bootstrap" role="form" data-toggle="validator" method="POST" action="" novalidate="novalidate">

        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">产品名称:</label>
            <div class="col-xs-12 col-sm-8 "  style="margin-top:9px;">
                <span>{$name}--{$res.pricetype}</span>
               <input  class="form-control" name="pricetype" value="{$res.pricetype}" type="hidden" >
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">自由行产品名称:</label>
            <div class="col-xs-12 col-sm-8 "  style="margin-top:9px;">
                <span>{$res.title}</span>&nbsp;&nbsp;&nbsp;&nbsp; <span>&nbsp;&nbsp;&nbsp;&nbsp;参考价:{$price.lowestprice}</span>
            </div>
        </div>
        {if condition="$res.pricetype eq 1"}
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">1人单价:</label>
                <div class="col-xs-12 col-sm-8 " >
                    <input id="price1" class="form-control" name="price1" value="{$result_num1.price}" type="text" style="width:100px;">
                    标题: <input id="title1" class="form-control" name="title1" value="{$result_num1.title}" type="text" style="width:300px;">
                    价格文字说明: <input  id="info1" class="form-control" name="info1" value="{$result_num1.info}" type="text" style="width:400px;">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">2人单价:</label>
                <div class="col-xs-12 col-sm-8 ">
                    <input id="price2"  class="form-control" name="price2" value="{$result_num2.price}" type="text" style="width:100px;">
                    标题: <input  id="title2"  class="form-control" name="title2" value="{$result_num2.title}" type="text" style="width:300px;">
                    价格文字说明: <input   id="info2" class="form-control" name="info2" value="{$result_num2.info}" type="text" style="width:400px;">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">3人单价:</label>
                <div class="col-xs-12 col-sm-8 " >
                    <input id="price3"  class="form-control" name="price3" value="{$result_num3.price}" type="text" style="width:100px;">
                    标题: <input  id="title3" class="form-control" name="title3" value="{$result_num3.title}" type="text" style="width:300px;">
                    价格文字说明: <input id="info3"  class="form-control" name="info3" value="{$result_num3.info}" type="text" style="width:400px;">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">4人单价:</label>
                <div class="col-xs-12 col-sm-8 " >
                    <input  id="price4" class="form-control" name="price4" value="{$result_num4.price}" type="text" style="width:100px;">
                    标题: <input  id="title4" class="form-control" name="title4" value="{$result_num4.title}" type="text" style="width:300px;">
                    价格文字说明: <input  id="info4" class="form-control" name="info4" value="{$result_num4.info}" type="text" style="width:400px;">
                </div>
            </div>
        {else/}
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">单价价格:</label>
                <div class="col-xs-12 col-sm-8 " >
                    <input  id="price" class="form-control" name="price" value="{$result_num.price}" type="text" style="width:100px;">
                    标题: <input id="title"  class="form-control" name="title" value="{$result_num.title}" type="text" style="width:200px;">
                    价格文字说明: <input  id="info" class="form-control" name="info" value="{$result_num.info}" type="text" style="width:400px;">
                </div>
            </div>
        {/if}

        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">单人房差:</label>
            <div class="col-xs-12 col-sm-8 ">
                <input  class="form-control" name="onehouse" value="{$onehouse.onehouse}" type="text" style="width:440px;">
            </div>
        </div>
        <div class="form-group layer-footer">
            <label class="control-label col-xs-12 col-sm-2"></label>
            <div class="col-xs-12 col-sm-8">
                <button type="button" class="btn btn-success btn-embossed" onclick="sub();">确定</button>
                <a href="/admin/product/product_chargeable?pid={$onehouse.pid}&fid=0" class="btn btn-default btn-embossed">返回</a>
            </div>
        </div>
    </form>
</div>
<script language="javascript" type="text/javascript" src="/assets/My97DatePicker/jquery-1.8.2.js"></script>
<script>
    function sub(){
        var price1=$("#price1").val();
        var title1=$("#title1").val();
        var info1=$("#info1").val();

        var price2=$("#price2").val();
        var title2=$("#title2").val();
        var info2=$("#info2").val();

        var price3=$("#price3").val();
        var title3=$("#title3").val();
        var info3=$("#info3").val();

        var price4=$("#price4").val();
        var title4=$("#title4").val();
        var info4=$("#info4").val();

        var price=$("#price").val();
        var title=$("#title").val();
        var info=$("#info").val()

        if(title1!='' || info1!=''){
            if(price1==''){
               alert("标题或价格文字说明有值则1人价格不得为空");
                return;
            }
        }
        if(title2!='' || info2!=''){
            if(price2==''){
                alert("标题或价格文字说明有值则2人价格不得为空");
                return;
            }
        }
        if(title3!='' || info3!=''){
            if(price3==''){
                alert("标题或价格文字说明有值则3人价格不得为空");
                return;
            }
        }
        if(title4!='' || info4!=''){
            if(price4==''){
                alert("标题或价格文字说明有值则4人价格不得为空");
                return;
            }
        }
        if(title!='' || info!=''){
            if(price==''){
                alert("标题或价格文字说明有值则价格不得为空");
                return;
            }
        }
         $("#add-form").submit();
    }



</script>

